package com.sfh.pst.http;


import com.sfh.base.RetrofitManager;
import com.sfh.base.http.IRxHttpClient;
import com.sfh.base.http.server.RxHttpClient;
import com.sfh.base.mvp.AbstractPstBase;
import com.sfh.base.mvp.IView;


import rx.Observable;
import rx.Subscriber;
import rx.Subscription;

/**
 * 功能描述:异步网络请求
 *
 * @date 2016/11/14
 */
public class AbstractHttpPresenter<IV extends IView> extends AbstractPstBase<IV> implements IRxHttpClient {


    @Override
    public <T> T create(Class<T> service) {

        return RxHttpClient.SingleTonHolder.create (service);
    }

    public <T> Subscription execute(Observable<T> observable, Subscriber<T> subscriber) {

        return RetrofitManager.execute (observable, subscriber);
    }
}
